﻿@model DistanceLearning.Models.ExamTest

@{
    Html.EnableClientValidation();   
}

@using (Html.BeginForm("EditingEdit", "ExamTest", FormMethod.Post, new { @class = "edit_form" })){
    @Html.Hidden("ExamTestID")
    @Html.Hidden("SubjectID")
    <div class="line">
        @Html.DevExpress().Label(
            settings => {
                settings.ControlStyle.CssClass = "label";
                settings.Text = "Название теста:";
                settings.AssociatedControlName = "TestName";
            }
        ).GetHtml()
        @Html.DevExpress().TextBox(
            settings => {
                settings.Name = "TestName";
                settings.ControlStyle.CssClass = "editor";
            }
        ).Bind(Model.TestName).GetHtml()
        @Html.ValidationMessageFor(model => model.TestName, null, new { @class = "validator" })
    </div>
    @*<div class="line">
        @Html.DevExpress().Label(
            settings => {
                settings.ControlStyle.CssClass = "label";
                settings.AssociatedControlName = "Subject.SubjectName";
                settings.Text = "Предмет:";
            }
        ).GetHtml()
        @Html.DevExpress().ComboBox(
            settings => {
                settings.Name = "Subject.SubjectName";
                settings.ControlStyle.CssClass = "editor";
                settings.Properties.TextField = "SubjectName";
                settings.Properties.ValueField = "SubjectName";
                //settings.Properties.ValueType = typeof(int);
            }
        ).BindList(ViewData["Subjects"]).Bind(Model.SubjectID).GetHtml()
        @Html.ValidationMessageFor(model => model.SubjectID, null, new { @class = "validator" })
    </div>*@
    <div class="line">
        @Html.DevExpress().Label(
            settings => {
                settings.ControlStyle.CssClass = "label";
            }
        ).GetHtml()
        @Html.DevExpress().Button(
            settings => {
                settings.Name = "btnUpdate";
                settings.ControlStyle.CssClass = "button";
                settings.Text = "Обновить";
                settings.UseSubmitBehavior = true;
            }
        ).GetHtml()
        @Html.DevExpress().Button(
            settings => {
                settings.Name = "btnCancel";
                settings.ControlStyle.CssClass = "button";
                settings.Text = "Отменить";
                settings.ClientSideEvents.Click = "function(s, e){ document.location='" + DevExpressHelper.GetUrl(new { Controller = "ExamTest", Action = "Index" }) + "'; }";
            }
        ).GetHtml()
    </div>
}